<include file="../header" />
</head>
<body class="J_scroll_fixed">
<script type="text/javascript">
    $(function() {

        if("{$hisRx.patient_name}" != ""){
            if(confirm("是否加载 {$hisRx.patient_name}_{$hisRx.side}_{$hisRx.admin_name}({$hisRx.update_time}) 更新的处方记录？")){
                var id = "{$workorder.workorder_id}";
                var hisId = "{$hisRx.rx_common_id}";

                var url ="/admin/workorder/rx?id="+id+"&hisId="+hisId;
                window.location.href = url;
            }
        }
        $("select[name='patient']").change(function () {
            var id = "{$workorder.workorder_id}";
            var hisId = $("select[name='patient']").val();
            if(!confirm("是否加载 "+$("select[name='patient']").find("option:selected").text()+"的处方记录？")){
                return false;
            }else {
                var url = "/admin/workorder/rx?id=" + id + "&hisId=" + hisId;
                window.location.href = url;
            }
        });
/*
        if($("select[name='combo']").val() == "否") {
            $(".combo-in").hide();
        };

        $("select[name='combo']").change(function () {
            if($("select[name='combo']").val() == "是") {
                $(".combo-in").show();
            } else {
                $(".combo-in").hide();
            }

        });
*/
        $("input[name=completed]").click(function() {
            if($("input[name=completed]").is(':checked')) {
                $("button.btn_submit").text("完成");
            }else{
                $("button.btn_submit").text("更新");
            }
        });

        $("button.btn_submit").click(function() {
            if($("input[name=completed]").is(':checked')) {
                if (confirm("勾选'完成'后提交处方单将无法再次修改，是否继续提交")) {
                    $("button.btn_submit").hide();
                } else {
                    return false;
                }
            }else{
                $("button.btn_submit").hide();
            }
        })

//        $("button.btn_submit").click(function() {
//
//            if($("input[name=completed]").is(':checked')) {
//                if (!confirm("勾选'完成'后提交处方单将无法再次修改，是否继续提交？")) {
//                    return false;
//                }else{
////                    $("form").submit();
//                }
//            }
//        });
    })
</script>
<div class="wrap jj">
    <div class="common-form">
        <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Workorder/rx_shank_post')}" onkeydown="if(event.keyCode==13)return false;" >
            <input type="hidden" name="workorderId" value="{$workorderId}" />
            <input type="hidden" name="rxId" value="{$rxId}" />
            <fieldset>
                <div class="control-group">
                    <label class="control-label"></label>
                    <div class="controls" style="font-weight: bold; font-size: larger">
                        {$workorder.patient_name}({$workorder.side})
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">历史病例:</label>
                    <div class="controls">
                        <select name="patient" style="width: 600px">
                            {:getRxCommonSelectOptionHtml($workorder['rx_common_id'], $workorder['patient_name'], $workorder['workorder_type'])}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">残肢类型:</label>
                    <div class="controls">
                        <select style="width:195px;" name="rt0">
                            {:getFormDictSelectOption($rx['rt0'],'stump_type','rxShank',1)}
                        </select>
                        <input type="text" class="input"  style="width: 400px" name="rt7" value="{$rx.rt7}" placeholder="其他残肢类型">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">假肢接受腔口类型:</label>
                    <div class="controls">
                        <select style="width:195px;" name="rt0">
                            {:getFormDictSelectOption($rx['rt0'],'socket_type','rxShank',1)}
                        </select>
                        <input type="text" class="input"  style="width: 400px" name="rt7" value="{$rx.rt7}" placeholder="其他假肢接受腔口类型">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">阴型及调整：</label>
                    <div class="controls">
                        <textarea style="height:80px; width: 600px;" name="long0">{$rx.long0}</textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">阳型及调整：</label>
                    <div class="controls">
                        <textarea style="height:80px; width: 600px;" name="long0">{$rx.long0}</textarea>
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">接受腔材料选择:</label>
                    <div class="controls">
                        <select style="width:195px;" name="rt0">
                            {:getFormDictSelectOption($rx['rt0'],'material_type','rxShank',1)}
                        </select>
                        <input type="text" class="input"  style="width: 400px" name="rt7" value="{$rx.rt7}" placeholder="其他接受腔材料">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" style="font-weight: bold">假肢部件选择:</label>
                    <div class="controls">
                        <input type="text" class="input" style="width: 600px" name="rt1" value="{$rx.rt1}" placeholder="例如奥托博克奥索等">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox inline" style="font-weight: bold">
                            <input type="checkbox"  name="completed">完成（勾选后提交处方将无法再次修改）
                        </label>
                    </div>
                </div>

            </fieldset>
            <div class="form-actions">
                <input type="hidden" name="rxId" value="{$rxId}" />
                <input type="hidden" name="id" value="{$id}" />
                <button type="submit" class="btn btn-primary btn_submit ">更新</button>
                <a class="btn" href="__URL__">返回</a>
            </div>
        </form>
    </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>